package com.baosight.sczx.common.zm.cInterface.cn;

import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;

import com.baosight.iplat4j.core.spring.SpringApplicationContext;
import com.baosight.iplat4j.dao.Dao;
import com.baosight.sczx.zm.cn.domain.ZMCNMtcl;
/**
 * <p>Title: CoalYield.java</p>
 * <p>Description: 产量上报对外接口</p>
 * <p>Copyright: Baosight Software LTD.co Copyright (c) 2002</p>
 * <p>Company: Baosight Software</p>
 * @author lhx
 * @version 1.0
 * <pre>Histroy:
 *          2016-9-1  李红星  Create
 *</pre>
 */
public class CoalYield {
	
	private static Dao dao = (Dao)SpringApplicationContext.getBean("dao");
	
	/**
	 * 
	 * @param type 类型：1表示日累计；2表示月累计；3表示年累计
	 * @param fdVirtualDate
	 * @param fdMiningId
	 * @param beginDate
	 * @param endDate
	 * @return
	 */
	@SuppressWarnings("rawtypes")
	public static BigDecimal getMinesum(int type,String fdVirtualDate,String fdMiningId,String beginDate,String endDate){
		BigDecimal minesum = null;
		HashMap<Object, Object> params = new HashMap<Object, Object>();
		if(1==type)
			params.put("fdVirtualDate", fdVirtualDate);
		else{
			params.put("fdbeginDate", beginDate);
			params.put("fdEndDate", endDate);
		}
		params.put("fdMiningId", fdMiningId);
		List list = dao.query("ZMCNMtcl.querySUM",params);
        if(list!=null&&list.size()>0){
        	ZMCNMtcl _tmpbean = (ZMCNMtcl)list.get(0);
        	minesum = _tmpbean.getFdCl();
        }              	
 		return minesum;
	}
	
}
	
